package proxy.dynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class SmsProxy implements InvocationHandler {
    private final Object target;

    public SmsProxy(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws InvocationTargetException, IllegalAccessException {
        // ...
        System.out.println(target.getClass());
        Object invoke = method.invoke(target, args);
        //..
        return invoke;
    }
}
